package com.itsm.controller;


import com.itsm.service.AccessTokenService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.util.HashMap;

@RestController
public class WenTokenController {

    @Autowired
    private AccessTokenService accessTokenService;

    @GetMapping("getWenToken")
    public HashMap<String, String> getWenToken() throws IOException {
        HashMap<String,String> token = new HashMap<>();
        token.put("token",accessTokenService.getWenToken("h211016hmjy","h211016hmjy"));
        return token;
    }

    @GetMapping("getBWenToken")
    public HashMap<String, String> getBWenToken() throws IOException {
        HashMap<String,String> token = new HashMap<>();
        token.put("token",accessTokenService.getWenToken("h230317szsh","h230317szsh"));
        return token;
    }



    @GetMapping("getBWenToken1")
    public HashMap<String, String> getBWenToken1() throws IOException {
        HashMap<String,String> token = new HashMap<>();
        token.put("token",accessTokenService.getWenToken("h211016hmjy","h211016hmjy"));
        return token;
    }
}
